import 'package:app/pages/login_modules/register_module/register_set_password_module/register_setpassword_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:get/get.dart';

import '../../../../utils/hexcolor.dart';

class RegisterSetPasswordView extends GetView{


  var phoneStr;
  var codeStr;
  RegisterSetPasswordView({this.phoneStr,this.codeStr});

  RegisterSetPassWordController controller = Get.put(RegisterSetPassWordController());


  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
      ),
      body: GetBuilder<RegisterSetPassWordController>(builder: (_){
        return Column(
          crossAxisAlignment:CrossAxisAlignment.start,
          children: [
            Container(
              margin: EdgeInsets.only(top: 10,left: 15),
              child: Text('设置登录密码'.tr,style: TextStyle(fontSize: 24,fontWeight: FontWeight.w500),),

            ),

            Container(
                margin: EdgeInsets.only(top: 10,left: 20),
                child: Column(
                  children: [
                    // TextField(
                    //   controller: tf3,
                    //   obscureText : false,
                    //
                    //   style: TextStyle(fontSize: 24,color: HexColor('#242A36')),
                    //   decoration: InputDecoration(
                    //
                    //       hintStyle: TextStyle(fontSize: 24,color: HexColor('#CCCCCC')),
                    //       border: InputBorder.none,
                    //       hintText: '项目名称'
                    //   ),
                    // ),
                    // Container(height: 1,color: HexColor('#EEEEEE'),margin: EdgeInsets.only(right: 15),),
                    //
                    // TextField(
                    //   controller: tf4,
                    //   obscureText : false,
                    //
                    //   style: TextStyle(fontSize: 24,color: HexColor('#242A36')),
                    //   decoration: InputDecoration(
                    //
                    //       hintStyle: TextStyle(fontSize: 24,color: HexColor('#CCCCCC')),
                    //       border: InputBorder.none,
                    //       hintText: '单位名称'
                    //   ),
                    // ),
                    // Container(height: 1,color: HexColor('#EEEEEE'),margin: EdgeInsets.only(right: 15),),

                    Container(

                      child: Row(
                        children: [
                          Container(
                            width: Get.width-100,
                            child: TextField(
                              controller: controller.tf1,
                              obscureText : controller.showps1,
                              inputFormatters: [
                                LengthLimitingTextInputFormatter(16)
                              ],
                              style: TextStyle(fontSize: 24,color: HexColor('#242A36')),
                              decoration: InputDecoration(

                                  hintStyle: TextStyle(fontSize: 24,color: HexColor('#CCCCCC')),
                                  border: InputBorder.none,
                                  hintText: '8-16位密码'.tr
                              ),
                            ),
                          ),
                          IconButton(onPressed: (){

                            controller.tapClickShowPassWord1();
                          }, icon: Image.asset('images/showps.png',width: 15,height: 15,)),
                        ],
                      ),
                    ),
                    Container(height: 1,color: HexColor('#EEEEEE'),margin: EdgeInsets.only(right: 15),),

                    Container(
                        margin: EdgeInsets.only(top: 15),
                        child:Row(
                          children: [
                            Container(
                              width: Get.width-100,
                              child: TextField(
                                controller: controller.tf2,
                                obscureText : controller.showps2,
                                inputFormatters: [
                                  LengthLimitingTextInputFormatter(16)
                                ],
                                style: TextStyle(fontSize: 24,color: HexColor('#242A36')),
                                decoration: InputDecoration(

                                    hintStyle: TextStyle(fontSize: 24,color: HexColor('#CCCCCC')),
                                    border: InputBorder.none,
                                    hintText: '确认密码'.tr
                                ),
                              ),
                            ),
                            IconButton(onPressed: (){
                              controller.tapClickShowPassWord2();
                            }, icon: Image.asset('images/showps.png',width: 15,height: 15,)),
                          ],
                        )
                    ),
                    Container(height: 1,color: HexColor('#EEEEEE'),margin: EdgeInsets.only(right: 15),),

                    Container(
                      margin: EdgeInsets.only(top: 50,right: 25,left: 25),
                      width: Get.width,
                      height: 45,
                      child: MaterialButton(
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(22),
                        ),
                        color:Theme.of(context).primaryColor,
                        onPressed: ()async{
                          controller.tapClickEnter(phoneStr,codeStr);
                        },
                        child: Text('确定'.tr,style: TextStyle(color: Colors.white),),
                      ),
                    ),
                  ],
                )
            )
          ],
        );
      }),
    );
  }

}